package domain.entities;

import javax.persistence.*;
import java.util.Collections;
import java.util.Date;
import java.util.LinkedHashMap;

import static javax.persistence.GenerationType.IDENTITY;

/**
 * Saes entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "saes", catalog = "bms")
public class Saes implements java.io.Serializable {

	// Fields

	private Integer id;
	private ProtocoloCentro protocoloCentro;
	private Date dateSubmissionBms;
	private String event;
	private Date eventDate;
	private String initialFollowUp;
	private Integer patientId;
	private Date submissionExternalEc;
	private Date submissionLocalEc;
	private Date submissionTeachingC;
    private boolean saeRelated;
    private Integer scope;

    public static final String CLASSTITLE = "SAEs";
    public static final LinkedHashMap<String, String> TITULOS = new LinkedHashMap<String, String>(
        Collections.unmodifiableMap(
            new LinkedHashMap<String, String>() {
                {
                    put("event", "Event");
                    put("initialFollowUp", "Initial / Follow Up");
                    put("patientId", "Patient #");
                    put("eventDate", "Event Date");
                    put("saeRelated", "SAE Related");
                    put("dateSubmissionBms", "Date of Submission to BMS");
                    put("submissionExternalEc", "Submission to External EC");
                    put("submissionLocalEc", "Submission to Local EC");
                    put("submissionTeachingC", "Submission to Teaching Committee");
                }
            }
        )
    );

    // Constructors

	/** default constructor */
	public Saes() {
	}

	/** minimal constructor */
	public Saes(ProtocoloCentro protocoloCentro) {
		this.protocoloCentro = protocoloCentro;
	}

	/** full constructor */
	public Saes(ProtocoloCentro protocoloCentro, Date dateSubmissionBms,
			String event, Date eventDate, String initialFollowUp,
			Integer patientId, Date submissionExternalEc,
			Date submissionLocalEc, Date submissionTeachingC) {
		this.protocoloCentro = protocoloCentro;
		this.dateSubmissionBms = dateSubmissionBms;
		this.event = event;
		this.eventDate = eventDate;
		this.initialFollowUp = initialFollowUp;
		this.patientId = patientId;
		this.submissionExternalEc = submissionExternalEc;
		this.submissionLocalEc = submissionLocalEc;
		this.submissionTeachingC = submissionTeachingC;
	}

	// Property accessors
	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumns( {
			@JoinColumn(name = "PROTOCOLO_CENTROCENTROid", referencedColumnName = "CENTROid", nullable = false),
			@JoinColumn(name = "protocolo_centroprotocolo_compromisopaisprotocoloid", referencedColumnName = "protocolo_compromisopaisprotocoloid", nullable = false),
			@JoinColumn(name = "protocolo_centroprotocolo_compromisopaiscompromisopaisid", referencedColumnName = "protocolo_compromisopaiscompromisopaisid", nullable = false) })
	public ProtocoloCentro getProtocoloCentro() {
		return this.protocoloCentro;
	}

	public void setProtocoloCentro(ProtocoloCentro protocoloCentro) {
		this.protocoloCentro = protocoloCentro;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "dateSubmissionBMS", length = 10)
	public Date getDateSubmissionBms() {
		return this.dateSubmissionBms;
	}

	public void setDateSubmissionBms(Date dateSubmissionBms) {
		this.dateSubmissionBms = dateSubmissionBms;
	}

	@Column(name = "event")
	public String getEvent() {
		return this.event;
	}

	public void setEvent(String event) {
		this.event = event;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "eventDate", length = 10)
	public Date getEventDate() {
		return this.eventDate;
	}

	public void setEventDate(Date eventDate) {
		this.eventDate = eventDate;
	}

	@Column(name = "initialFollowUp")
	public String getInitialFollowUp() {
		return this.initialFollowUp;
	}

	public void setInitialFollowUp(String initialFollowUp) {
		this.initialFollowUp = initialFollowUp;
	}

	@Column(name = "patientId")
	public Integer getPatientId() {
		return this.patientId;
	}

	public void setPatientId(Integer patientId) {
		this.patientId = patientId;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "submissionExternalEC", length = 10)
	public Date getSubmissionExternalEc() {
		return this.submissionExternalEc;
	}

	public void setSubmissionExternalEc(Date submissionExternalEc) {
		this.submissionExternalEc = submissionExternalEc;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "submissionLocalEC", length = 10)
	public Date getSubmissionLocalEc() {
		return this.submissionLocalEc;
	}

	public void setSubmissionLocalEc(Date submissionLocalEc) {
		this.submissionLocalEc = submissionLocalEc;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "submissionTeachingC", length = 10)
	public Date getSubmissionTeachingC() {
		return this.submissionTeachingC;
	}

	public void setSubmissionTeachingC(Date submissionTeachingC) {
		this.submissionTeachingC = submissionTeachingC;
	}

    @Column(name = "saeRelated")
    public boolean isSaeRelated() {
        return saeRelated;
    }

    public void setSaeRelated(boolean saeRelated) {
        this.saeRelated = saeRelated;
    }

    @Column(name = "scope")
    public Integer getScope() {
        return scope;
    }

    public void setScope(Integer scope) {
        this.scope = scope;
    }
}